package com.prj.ufdm.cloud.ms.core.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 	地域
 * </p>
 *
 * @author chichangxian
 * @since 2019-09-27
 */
public class SysArea implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private String id;

    /**
     * 地域名称
     */
    private String areaName;

    /**
     * 地域编号
     */
    private String areaCode;

    /**
     * 地域类型
     */
    private String areaType;

    /**
     * 地域类型名称
     */
    private String areaTypeName;

    /**
     * 父id
     */
    private String parentId;

    /**
     * 备注
     */
    private String remark;
    /**
     * 	子集
     */
    private List<SysArea> children=new ArrayList<SysArea>();

    public List<SysArea> getChildren() {
		return children;
	}

	public void setChildren(List<SysArea> children) {
		this.children = children;
	}

	public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }
    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }
    public String getAreaType() {
        return areaType;
    }

    public void setAreaType(String areaType) {
        this.areaType = areaType;
    }
    public String getAreaTypeName() {
    	if("1".equals(this.areaType)) {
    		return "国家";
    	}
    	if("2".equals(this.areaType)) {
    		return "省份、直辖市";
    	}
    	if("3".equals(this.areaType)) {
    		return "地市";
    	}
    	if("4".equals(this.areaType)) {
    		return "区县";
    	}
        return areaTypeName;
    }

    public void setAreaTypeName(String areaTypeName) {
        this.areaTypeName = areaTypeName;
    }
    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "SysArea{" +
        "id=" + id +
        ", areaName=" + areaName +
        ", areaCode=" + areaCode +
        ", areaType=" + areaType +
        ", areaTypeName=" + areaTypeName +
        ", parentId=" + parentId +
        ", remark=" + remark +
        "}";
    }
}
